package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TournamentProgressMapper;
import com.ruoyi.system.domain.TournamentProgress;
import com.ruoyi.system.service.ITournamentProgressService;

/**
 * 赛事项目/进度Service业务层处理
 *
 * @author ruoyi
 * @date 2022-04-26
 */
@Service
public class TournamentProgressServiceImpl implements ITournamentProgressService
{
    @Autowired
    private TournamentProgressMapper tournamentProgressMapper;

    /**
     * 查询赛事项目/进度
     *
     * @param id 赛事项目/进度主键
     * @return 赛事项目/进度
     */
    @Override
    public TournamentProgress selectTournamentProgressById(Long id)
    {
        return tournamentProgressMapper.selectTournamentProgressById(id);
    }

    /**
     * 查询赛区项目详情页
     * @param tournamentProgress
     * @return
     */
    @Override
    public List<TournamentProgress> selectTournamentProgressQueryViewList(TournamentProgress tournamentProgress){
        return tournamentProgressMapper.selectTournamentProgressQueryViewList(tournamentProgress);
    }

    /**
     * 查询赛事项目/进度列表
     *
     * @param tournamentProgress 赛事项目/进度
     * @return 赛事项目/进度
     */
    @Override
    public List<TournamentProgress> selectTournamentProgressList(TournamentProgress tournamentProgress)
    {
        return tournamentProgressMapper.selectTournamentProgressList(tournamentProgress);
    }

    /**
     * 新增赛事项目/进度
     *
     * @param tournamentProgress 赛事项目/进度
     * @return 结果
     */
    @Override
    public int insertTournamentProgress(TournamentProgress tournamentProgress)
    {
        tournamentProgress.setCreateTime(DateUtils.getNowDate());
        return tournamentProgressMapper.insertTournamentProgress(tournamentProgress);
    }

    /**
     * 修改赛事项目/进度
     *
     * @param tournamentProgress 赛事项目/进度
     * @return 结果
     */
    @Override
    public int updateTournamentProgress(TournamentProgress tournamentProgress)
    {
        tournamentProgress.setUpdateTime(DateUtils.getNowDate());
        return tournamentProgressMapper.updateTournamentProgress(tournamentProgress);
    }

    /**
     * 批量删除赛事项目/进度
     *
     * @param ids 需要删除的赛事项目/进度主键
     * @return 结果
     */
    @Override
    public int deleteTournamentProgressByIds(Long[] ids)
    {
        return tournamentProgressMapper.deleteTournamentProgressByIds(ids);
    }

    /**
     * 删除赛事项目/进度信息
     *
     * @param id 赛事项目/进度主键
     * @return 结果
     */
    @Override
    public int deleteTournamentProgressById(Long id)
    {
        return tournamentProgressMapper.deleteTournamentProgressById(id);
    }
}
